package com.siemens.industrial.model.partner;

import org.springframework.jdbc.core.RowMapper;

import java.util.Date;

/**
 * Created by qupen on 2016/9/18.
 */
public class Event {
    private String eventId;
    private String eventName;
    private String eventType;
    private String eventDesc;
    private String eventTrigger;
    private Date createTime;
    private Date updateTime;

    private static final RowMapper<Event> rowMapper = (resultSet, i) -> {
        Event event = new Event();
        event.setEventId(resultSet.getString("event_id"));
        event.setEventName(resultSet.getString("event_name"));
        event.setEventType(resultSet.getString("event_type"));
        event.setEventDesc(resultSet.getString("event_desc"));
        event.setEventTrigger(resultSet.getString("event_trigger"));
        event.setCreateTime(new Date(resultSet.getTimestamp("create_time").getTime()));
        event.setUpdateTime(new Date(resultSet.getTimestamp("create_time").getTime()));
        return event;
    };

    public static RowMapper<Event> getRowMapper() {
        return rowMapper;
    }

    //<editor-fold desc="getters and setters">

    public String getEventId() {
        return eventId;
    }

    public void setEventId(String eventId) {
        this.eventId = eventId;
    }

    public String getEventName() {
        return eventName;
    }

    public void setEventName(String eventName) {
        this.eventName = eventName;
    }

    public String getEventType() {
        return eventType;
    }

    public void setEventType(String eventType) {
        this.eventType = eventType;
    }

    public String getEventDesc() {
        return eventDesc;
    }

    public void setEventDesc(String eventDesc) {
        this.eventDesc = eventDesc;
    }

    public String getEventTrigger() {
        return eventTrigger;
    }

    public void setEventTrigger(String eventTrigger) {
        this.eventTrigger = eventTrigger;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    //</editor-fold>
}
